import os

import yaml


def load_config(app):
    env = os.getenv('env', 'dev')
    with open("app-"+env+".yaml", 'rb') as f:
        cf = yaml.safe_load(f.read())
        app.config.update(cf)
        app.config["SQLALCHEMY_ECHO"] = True

